#include "pch.h"
#include "UISettingsDlg.h"
#include "GaojieDriveApp.h"
#include "UIWndManager.h"

CUISettingsDlg::CUISettingsDlg(bool bModal)
	: m_bModal(bModal)
{
	AssertInUIThread();
}

LRESULT CUISettingsDlg::OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	HICON hIcon = GetApp()->GetUIWndManager()->GetMainIcon();
	SetIcon(hIcon, TRUE);
	SetIcon(hIcon, FALSE);

	CenterWindow(GetParent());
	return TRUE;
}

LRESULT CUISettingsDlg::OnOkCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	if (m_bModal)
		EndDialog(wID);
	else
		DestroyWindow();

	return 0;
}

LRESULT CUISettingsDlg::OnBtnClick1(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	return 0;
}

void CUISettingsDlg::OnFinalMessage(HWND)
{
	if (!m_bModal)
		delete this;
}
